//
//  OSRecommendTagCell.m
//  百思不得姐
//
//  Created by PushMeBaby on 16/2/23.
//  Copyright © 2016年 CoderC. All rights reserved.
//

#import "OSRecommendTagCell.h"
#import "OSRecommendTag.H"
@interface OSRecommendTagCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;

@property (weak, nonatomic) IBOutlet UILabel *themeNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *subNumberLabel;

@end


@implementation OSRecommendTagCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setRecommendTag:(OSRecommendTag *)recommendTag{
    _recommendTag = recommendTag;
    
    
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:recommendTag.image_list] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
    
    self.themeNameLabel.text = recommendTag.theme_name;
    
    NSString *subNumber = nil;
    
    
    
    if (recommendTag.sub_number > 10000.0) {
        subNumber = [NSString stringWithFormat:@"%.1f万人订阅",recommendTag.sub_number / 10000.0];
    }else{
        subNumber = [NSString stringWithFormat:@"%zd人订阅",recommendTag.sub_number];
    }
    
    self.subNumberLabel.text = subNumber;
    
    
}

-(void)setFrame:(CGRect)frame{
    frame.origin.x = 5;
    frame.size.width -= 2 * frame.origin.x;
    frame.size.height -= 1;
    
    [super setFrame:frame];
}

@end
